﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace ModernUILogViewer.Converters
{
    class DateListConverter : IValueConverter
    {
        public object Convert(object value, Type TargetType, object parameter, CultureInfo culture)
        {
            IList<DateTime> list = (IList<DateTime>)value;

            if (list != null && list.Count > 0 && list[0] != DateTime.MinValue.Date)
                list.Insert(0, DateTime.MinValue.Date);

            return list;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
